import Vue from 'vue'
import App2 from './App2.vue'
import VueResource from 'vue-resource'
import VueRouter from 'vue-router'
Vue.use(VueResource);

//引入创建的四个页面
import Home from './Home.vue'
import Explorer from './Explorer.vue'
import Cart from './Cart.vue'
import Me from './Me.vue'
//实现路由实例插件
Vue.use(VueRouter);

const router =new VueRouter({
  mode:'history',
  base:__dirname,
  routes:[
      //将页面组件与path指定的路由关联
    {name:'home',path:'/',component:Home},
    {name:'explorer',path:'/explorer',component:Explorer},
    {name:'cart',path:'/cart',component:Cart},
    {name:'me',path:'/me',component:Me},
  ]
})
new Vue({
  http:{root:"/",headers:{}},
  el: '#app',
  router,
  render: h => h(App2)
})
